/**
 * 
 */
package com.easidea.tim.entity.purchase;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springside.core.dao.extend.Undeletable;

import com.easidea.tim.entity.BaseEntity;
import com.easidea.tim.entity.commodity.Product;

/**
 * @author Harrison
 *
 */

@Entity(name="tim_purchase_return_item")
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Cache(region="tim_purchase_return_item", usage=CacheConcurrencyStrategy.READ_WRITE)
@Undeletable(status="deleted")
public class PurchaseReturnItem extends BaseEntity {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 4332105111061303001L;

	private PurchaseReturn purchaseReturn; //采购退货单
	
	private Product product; //单品
	
	private String productName;
	
	private String productColor; 
	
	private String meterNum;
	
	private Double piNum;
	
	private String meters;
	
	private Double unitPrice; // 单价
	
	private Double totalMeter; 
	
	private String memo;

	/**
	 * @return the purchaseReturn
	 */
	@ManyToOne(fetch=FetchType.LAZY, cascade=CascadeType.MERGE)
	@JoinColumn(name="purchase_return_id",nullable=false )
	public PurchaseReturn getPurchaseReturn() {
		return purchaseReturn;
	}

	/**
	 * @param purchaseReturn the purchaseReturn to set
	 */
	public void setPurchaseReturn(PurchaseReturn purchaseReturn) {
		this.purchaseReturn = purchaseReturn;
	}

	/**
	 * @return the product
	 */
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="product_id",nullable=false )
	public Product getProduct() {
		return product;
	}

	/**
	 * @param product the product to set
	 */
	public void setProduct(Product product) {
		this.product = product;
	}

	/**
	 * @return the productName
	 */
	@Column(name="product_name")
	public String getProductName() {
		return productName;
	}

	/**
	 * @param productName the productName to set
	 */
	public void setProductName(String productName) {
		this.productName = productName;
	}

	/**
	 * @return the productColor
	 */
	@Column(name="product_color")
	public String getProductColor() {
		return productColor;
	}

	/**
	 * @param productColor the productColor to set
	 */
	public void setProductColor(String productColor) {
		this.productColor = productColor;
	}

	/**
	 * @return the meterNum
	 */
	@Column(name="meter_num")
	public String getMeterNum() {
		return meterNum;
	}

	/**
	 * @param meterNum the meterNum to set
	 */
	public void setMeterNum(String meterNum) {
		this.meterNum = meterNum;
	}

	/**
	 * @return the piNum
	 */
	@Column(name="pi_num", columnDefinition=" decimal(8,0) not null", nullable=false)
	public Double getPiNum() {
		return piNum;
	}

	/**
	 * @param piNum the piNum to set
	 */
	public void setPiNum(Double piNum) {
		this.piNum = piNum;
	}

	/**
	 * @return the unitPrice
	 */
	@Column(name="unit_price", columnDefinition="decimal(8,2) not null", nullable=false)
	public Double getUnitPrice() {
		return unitPrice;
	}

	/**
	 * @param unitPrice the unitPrice to set
	 */
	public void setUnitPrice(Double unitPrice) {
		this.unitPrice = unitPrice;
	}

	/**
	 * @return the totalMeter
	 */
	@Column(name="total_meter", columnDefinition="decimal(18,2) not null", nullable=false)
	public Double getTotalMeter() {
		return totalMeter;
	}

	/**
	 * @param totalMeter the totalMeter to set
	 */
	public void setTotalMeter(Double totalMeter) {
		this.totalMeter = totalMeter;
	}

	/**
	 * @return the memo
	 */
	@Column(name="memo")
	public String getMemo() {
		return memo;
	}

	/**
	 * @param memo the memo to set
	 */
	public void setMemo(String memo) {
		this.memo = memo;
	}

	@Column(name="meters")
	public String getMeters() {
		return meters;
	}

	public void setMeters(String meters) {
		this.meters = meters;
	}
	
	

}
